package com.monitor.app_monitor.entity.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.monitor.app_monitor.entity.ProvinceCode;
import com.monitor.app_monitor.entity.RealTimeAlarmDo;
import com.monitor.app_monitor.entity.TrsSegInfoDto;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

@Mapper
@DS("clickhouseunified")
public interface ResUnifClickhouseMapper {
    Integer findAllClick(String tableName, String emsIp);

    //通道表
    Integer getTrsChannelNo( String emsIp);

    //通道路由表
    Integer getTrsChannelRoute( String emsIp);

    //电路
    Integer getTrsCircuit( String emsIp);

    //电路路由
    Integer getTrsCircuitRoute(String emsIp);

    //传输段
    Integer getTrsSeg(String emsIp);

    //传输段路由
    Integer getTrsSegRoute(String emsIp);

    //获取传输段数量
    List<TrsSegInfoDto> getTrsSegInfo();

    @MapKey("ems_ip")
    List<Map<String,Integer>> getAllCountByEmsIp();


    @MapKey("province_code")
    Map<String,String> getCode();

    @Update("optimize table unified_resource.${tableName}  ON CLUSTER  zhuanqu_replication final")
    void optimizeTable(String tableName);
}
